﻿<!--#include file="../Include/Config.asp"-->
<link rel="stylesheet" href="../Css/Admin.css" type="text/css" />
<%
Survey_id=request.QueryString("Survey_id")
Question_id=request.QueryString("Question_id")
sql="select * from question where Question_id="&Question_id
rs.open sql,conn,1,1
if rs.eof then
	Call ShowAlert("参数错误","")
else
	Qtype=rs("Question_type")
	Question_content=rs("Question_content")
	Question_jdtz=rs("Question_jdtz")
	Question_answer=rs("Question_answer")
end if
rs.close
if Question_answer<>"" then
	Question_answer=split(Question_answer,"&")
else
    if Qtype<>5 then
		Call ShowAlert("该题目内无选项","")
	end if
end if
select case Qtype
	case "1","2": call type1()
	case "3","4": call type2()
	case "5": call type3()
end select
%>
<script language="javascript" src="../Js/QuestAdd.js"></script>
<%sub type1()%>
<form name="form1" action="QuestionSave.asp?Survey_id=<%=Survey_id%>&Question_id=<%=Question_id%>&action=jd" method="post">
问题：<input name="Question_content" type="text" size="40" value="<%=Question_content%>">
<br/><br/>
备选项：
<ul type="A" id="ulAnswer">
<%
if Question_jdtz<>"" then
Question_jdtz=split(Question_jdtz,"&")
    for i=0 to ubound(Question_answer)
	    if Question_jdtz(i)="over" then
			I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">设置截断"
			I1 "<input type=""checkbox"" name=""jd"" value="""&i&""" checked=""checked"">"
			I1 "</li>"
		else
		    if Question_jdtz(i)="null" then
				I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">设置截断"
				I1 "<input type=""checkbox"" name=""jd"" value="""&i&""">"
				I1 "</li>"
			else
				I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">已经设置跳转，不能设置截断"
				I1 "</li>"
			end if	
		end if	
	next
else
	i=0
	for each QueAns in Question_answer
	I1 "<li><input type=""text"" name=""Answer"" value="""&QueAns&""">设置截断"
	I1 "<input type=""checkbox"" name=""jd"" value="""&i&""">"
	I1 "</li>"
	i=i+1
	next
end if
%>
</ul>
<div id="button">
&nbsp;&nbsp;<input type="submit" name="submit1" value="保存">
&nbsp;&nbsp;<input name="reset1" type="reset" value="取消">
&nbsp;&nbsp;<input type="button" name="Back" value="返回" onClick="location.href='javascript:history.go(-1)';">
</div>
</form>
<%end sub%>

<%sub type2()%>
<form name="form1" action="QuestionSave.asp?Survey_id=<%=Survey_id%>&Question_id=<%=Question_id%>&action=jd" method="post">
问题：<input name="Question_content" type="text" size="40" value="<%=Question_content%>">
<br/><br/>
备选项：
<ul type="A" id="ulAnswer">
<%
if Question_jdtz<>"" then
    Question_jdtz=split(Question_jdtz,"&")
    for i=0 to (ubound(Question_answer)-1)
	    if Question_jdtz(i)="over" then
			I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">设置截断"
			I1 "<input type=""checkbox"" name=""jd"" value="""&i&""" checked=""checked"">"
			I1 "</li>"
		else
		    if Question_jdtz(i)="null" then
				I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">设置截断"
				I1 "<input type=""checkbox"" name=""jd"" value="""&i&""">"
				I1 "</li>"
			else
				I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">已经设置跳转，不能设置截断"
				I1 "</li>"
			end if	
		end if	
	next
	i=ubound(Question_answer)
	if Question_jdtz(i)="over" then
		I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">"
		I1 "&nbsp;<input type=""text"" name=""Answer_2"" readonly=""true"" value=""用户在此框输入自定义文本"">"
		I1 "设置截断"
		I1 "<input type=""checkbox"" name=""jd"" value="""&i&""" checked=""checked"">"
		I1 "</li>"
	else
		if Question_jdtz(i)="null" then
			I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">"
			I1 "&nbsp;<input type=""text"" name=""Answer_2"" readonly=""true"" value=""用户在此框输入自定义文本"">"	
			I1 "设置截断"
			I1 "<input type=""checkbox"" name=""jd"" value="""&i&""">"
			I1 "</li>"
		else
			I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">"
			I1 "&nbsp;<input type=""text"" name=""Answer_2"" readonly=""true"" value=""用户在此框输入自定义文本"">"	
			I1 "已经设置跳转，不能设置截断"
			I1 "</li>"
		end if	
	end if	
else
	i=0
	for i=0 to (ubound(Question_answer)-1)
	I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">设置截断"
	I1 "<input type=""checkbox"" name=""jd"" value="""&i&""">"
	I1 "</li>"
	next
	i=ubound(Question_answer)
	I1 "<li><input type=""text"" name=""Answer"" value="""&Question_answer(i)&""">"
	I1 "&nbsp;<input type=""text"" name=""Answer_2"" readonly=""true"" value=""用户在此框输入自定义文本"">"
	I1 "设置截断"
	I1 "<input type=""checkbox"" name=""jd"" value="""&i&""">"
	I1 "</li>"
end if
%>
</ul>
<div id="button">
&nbsp;&nbsp;<input type="submit" name="submit1" value="保存">
&nbsp;&nbsp;<input name="reset1" type="reset" value="取消">
&nbsp;&nbsp;<input type="button" name="Back" value="返回" onClick="location.href='javascript:history.go(-1)';">
</div>
</form>
<%end sub%>

<%sub type3()
Call ShowAlert("问答题不允许设置截断","")
end sub%>
